package seeders

import (
	"github.com/goravel/framework/facades"
	"goravel/app/models"
)

type RoleSeeder struct {
}

// Signature The name and signature of the seeder.
func (s *RoleSeeder) Signature() string {
	return "RoleSeeder"
}

// Run executes the seeder logic.
func (s *RoleSeeder) Run() error {
	query := facades.Orm().Query()
	query.Create(&models.Role{
		Name:   "驾驶员",
		Value:  "driver",
		Remark: "小程序提交工单，便于处理维修事务",
		Status: 1,
	})
	query.Create(&models.Role{
		Name:   "维修工",
		Value:  "employee_role",
		Remark: "维修工，负责汽车维修",
		Status: 1,
	})
	query.Create(&models.Role{
		Name:   "维修班长",
		Value:  "class_role",
		Remark: "维修班长，负责审批工时",
		Status: 1,
	})

	query.Create(&models.Role{
		Name:   "维修作业长",
		Value:  "flow_role",
		Remark: "维修作业长，负责处理异常工单，增加工时工单",
		Status: 1,
	})

	return nil
}
